package com.aaa.system.service.impl;

import com.aaa.core.entity.AclUser;
import com.aaa.core.entity.Results;
import com.aaa.system.dao.AclUserDao;
import com.aaa.system.service.AclUserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：ludi（206913808@qq.com）
 * @date ：Created in 2022/12/2 11:26
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class AclUserServiceImpl implements AclUserService {
    @Autowired
    private AclUserDao userDao;
    @Override
    public Results findByName(String username) {
        QueryWrapper<AclUser> wrapper=new QueryWrapper<>();
        wrapper.eq("username",username);
        wrapper.eq("is_deleted",0);
        AclUser aclUser = userDao.selectOne(wrapper);
        if(aclUser!=null){
            return new Results(2000,"查询用户信息成功",aclUser);
        }
        return null;
    }
}